package util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * @author wq3stone
 */
public class DBUtilTest {
    public static void main(String[] args) {
        PreparedStatement ps = null;
        Connection conn = null;
        String sql = "insert into t_user (username,password) values ('admin','admin')";
        try {
            conn = DBUtil.getConnection();
            ps = conn.prepareStatement(sql);
            ps.executeUpdate();
            System.out.println("成功！");
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DBUtil.close(conn,ps,null);
        }
    }
}
